import { Module } from "@nestjs/common";
import { VedioService } from "./vedio.service";
import { VedioController } from "./vedio.controller";
import { VedioGateway } from "./vedio.gateway";
import { RedisHandler } from "../utils";
import { REDIS_CONFIG } from "../config";
import { createClient } from "redis";
import { REDIS_PWD } from "../config/pass";

@Module({
  controllers: [VedioController],
  providers: [
    VedioService,
    {
      provide: "REDIS_CLIENT",
      async useFactory() {
        const client = createClient({
          url: `redis://:${REDIS_PWD}@hw.masaikk.fun:6379`,
        });
        // await client.connect();
        return client;
      },
    },
    VedioGateway,
  ],
})
export class VedioModule {}
